package com.nondo.rdp.finance.domain.course;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.nondo.rdp.core.domain.base.BaseEntity;
import com.nondo.rdp.finance.config.DbConfig;

/**
 * 首页-课程组
 */
@Entity
@Table(name = DbConfig.DEFAULT_TABLE_PREFIX + "course_group")
public class CourseGroup extends BaseEntity {
	private static final long serialVersionUID = -7642923566954475525L;
	private Long id;// 主键
	private String name; // 组名
	private Integer type; // 类型 0=新手上路|1=基本面选股|2=技术面选股
	private int sortNum; // 排序值

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @NotNull(message = "课程组名称不能为空")
    @Length(min = 1, max = 12, message = "课程组名称长度不能超过12个字符")
    @Column(name = "name", length = 12)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@NotNull(message = "类型不能为空")
    @Column(columnDefinition = "int default 0", nullable = false)
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(columnDefinition = "int default 0", nullable = false)
	public int getSortNum() {
		return sortNum;
	}

	public void setSortNum(int sortNum) {
		this.sortNum = sortNum;
	}

    
}
